<div class="search-box">
	<form class="search_form layui-form" lay-filter="month_contract_search_form">
		
		<div class="layui-inline">
			<label class="layui-form-label">日期</label>
			<div class="layui-input-inline">
				<input type="text" name="month" id="month" autocomplete="off" class="layui-input">
			</div>
		</div>
		
		<div class="layui-inline">
			<label class="layui-form-label">审核状态</label>
			<div class="layui-input-inline">
				<select name="audit" lay-filter="audit" id="audit" lay-search>
					<option value="">全部</option>
					<option value="0">未上传</option>
					<option value="1">通过</option>
					<option value="2">驳回</option>
					<option value="3">等待</option>
				</select>
			</div>
		</div>
		
		<div class="pack-up"></div>
	</form>
</div>
<table class="layui-hide" id="month_contract_list" lay-filter="month_contract_list"></table>
<script>
	var month_contract_list_url = "{:url('monthContract/ajaxList')}";
	var month_cols = {$cols};
	var contract_pass_url = "{:url('monthContract/pass')}";
	var contract_reject_url = "{:url('monthContract/reject')}";
	var contract_all_pass_url = "{:url('monthContract/ajaxAllPass')}";
	var contract_all_refuse_url = "{:url('monthContract/ajaxAllRefuse')}";
	var uploadOne  = "{:url('upload/uploadOne')}";
	var sny_state_url = "{:url('monthContract/snyState')}";
	
</script>

<script type="text/html" id="contract_fileTpl">
	{{# if(d.is_read == 0){ }}
		等待生成
	{{# }else if(d.contract_file == 'error'){ }}
		错误
	{{#} else { }}
	<a class="layui-btn layui-border-blue layui-btn-xs" href="{{d.contract_file}}" target="_blank">查看文件</a>
	{{# } }}
</script>

<script type="text/html" id="upload_fileTpl">
	{{# if(d.upload_file == null){ }}
		未上传
	{{#} else { }}
	<a class="layui-btn layui-btn-normal layui-btn-xs" href="{{d.upload_file}}" target="_blank">查看文件</a>
	{{# } }}
</script>

<script type="text/html" id="auditTpl">
	{{# if(d.audit == 1){}}
	<div class="layui-anim circle layui-bg-green" data-title="通过">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.audit == 0){ }}
	<div class="layui-anim circle layui-bg-black" data-title="未上传">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.audit == 3){ }}
	<div class="layui-anim circle layui-bg-orange" data-title="等待审核">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="驳回">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>



<script type="text/html" id="monthContractToolbar">
  <div class="layui-btn-container">
    <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" lay-event="allPass"><i class="layui-icon layui-icon-component"></i>批量通过</button>
    <button type="button" class="layui-btn layui-btn-sm layui-btn-warm" lay-event="allReject"><i class="layui-icon layui-icon-component"></i>批量驳回</button>
	<div class="layui-btn-group">
	<a data-title="同步状态" class="layui-btn layui-btn-warm layui-btn-sm layui-bg-green up-sny-state">同步状态</a>
	<a data-title="模板" class="layui-btn layui-btn-warm layui-btn-sm layui-bg-blue" href="/public/同步月度合同状态.xls" target="_blank">模板</a>
	</div>
  </div>
  
</script>
<script type="text/html" id="month_contract_tool">
	<div class="layui-btn-group">
		{{# if(d.audit == 3){}}
		<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="pass" data-type="1" data-id="{{ d.id}}" data-title="审核通过"><i class="layui-icon layui-icon-ok"></i></a>
		<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="reject" data-type="0" data-id="{{ d.id}}" data-title="驳回申请"><i class="layui-icon layui-icon-close"></i></a>
		{{#}}}
	</div>
</script>
<script src="/static/js/month_contract/contract.js" type="text/javascript" charset="utf-8"></script>